package org.ch00.test09.demo02;

/*
 *
 *@author XCH
 *@date 2025 - 03 - 10 - 19:36
 *
 */
public class SumRunnable implements Runnable{
    private int sum;
    private int start;
    private int end;

    public SumRunnable(int start, int end) {
        this.start = start;
        this.end = end;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    @Override
    public void run() {
        for (int i = start; i <= end; i++) {
            sum += i;
        }
    }
}
